backslashes are escaped in the new format - test case BNA to DFW
authorparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 17 Jan 2006 21:59:12 +0000 (21:59 +0000)
committerparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 17 Jan 2006 21:59:12 +0000 (21:59 +0000)
gpsbabel/google.c

index d73d4e6cdcb6bd581d02e61e19feab4cf7598a97..0b116805064c23ce70f17ba8084adbd41891c7ce 100644 (file)
@@ -183,6 +183,10 @@ static long decode_goog64( char **str )
        long result = 0;
        unsigned char c = 0;
        unsigned char shift = 0;
+
+        if ( !(**str)) {
+               return 0;
+       }
        
        do 
        {
@@ -306,9 +310,17 @@ google_read(void)
                    end = strchr( encoded_points, '\'' );
                    if ( end ) {
                      *end = '\0';
+                     end = encoded_points;
+                     while ( (end = strstr(end, "\\\\" ))) {
+                       memmove( end, end+1, strlen(end)+1 );
+                     }
                      end = strchr( encoded_levels, '\'' );
                      if ( end ) {
                        *end = '\0';
+                       end = encoded_levels;
+                       while ( (end = strstr(end, "\\\\" ))) {
+                         memmove( end, end+1, strlen(end)+1 );
+                       }
                        goog_poly_e( NULL, NULL );
                      }
                    }